-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maint: Replace usage of folly in clock.hpp
#1448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is is possible to check if the resolution of the clock is the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both have nanoseconds resolution seemingly calling clock_gettime
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
folly::chrono::clock_gettime_ns
's definition uses the vDSO on Linux (calling the vDSO is not considered a good practice (see the "Description" section of vdso(7)
's man page). Alternatively, it calls clock_gettime
.
std::chrono::system_clock::now
has nanosecond precision. and also calls clock_gettime
with CLOCK_REALTIME
.
The only drawback is that coarse_nanos_since_epoch
who used to return coarse precision timestamp (see CLOCK_REALTIME_COARSE
) now returns an accurate timestamp. Must we refine it or not?
Signed-off-by: Julien Jerphanion <[email protected]>
0785fd2
to
12d7671
Compare
Signed-off-by: Julien Jerphanion <[email protected]> Co-authored-by: William Dealtry <[email protected]>
Reference Issues/PRs
Part of #1412.
What does this implement or fix?
folly::chrono::clock_gettime_ns
's definition uses the vDSO on Linux (calling the vDSO is not considered a good practice (see the "Description" section ofvdso(7)
's man page). Alternatively, it callsclock_gettime
.std::chrono::system_clock::now
has nanosecond precision. and also callsclock_gettime
withCLOCK_REALTIME
.libstdc++
does not useCLOCK_REALTIME_COARSE
at all..Hence, the only drawback is that
coarse_nanos_since_epoch
who used to return coarse precision timestamp (seeCLOCK_REALTIME_COARSE
) now returns an accurate timestamp. Must we keep coarse precision or not?Any other comments?
Checklist
Checklist for code changes...